package json.model;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.util.List;

/**
 * All rights Reserved, Designed By www.tusdao.com
 *
 * @version V1.0
 * @Title: BcMonitorInfo.java
 * @Package com.tusdao.explorer.hyperledger.model
 * @Description: TODO(用一句话描述该文件做什么)
 * @author: tusxxw
 * @date: 2020/9/1 3:33 下午
 * @Copyright: 2020 www.tbs.com Inc. All rights reserved.
 * <p>
 * 注意：本内容仅限于TBS项目组内部传阅，禁止外泄以及用于其他的商业目的
 */
@Data
public class BcMonitorInfo {

    private Info info; //业务信息

    @JSONField(name = "data")
    private List<BcData> bcData; //区块链监控信息

    @Data
    static class Info{

        private String uuid; //主机UUID

        private String expIp; //浏览器id
    }

    @Data
    static class BcData {
        private String bcName; //区块链名称|通道名称

        private String bcHash; //区块链hash|通道hash

        private Integer blockCount; //区块数量

        private Integer txCount; //交易数量

        private Integer peerCount; //节点数量

        private Integer smcCount; //合约数量|链码数量

        @JSONField(name = "bc_block")
        private List<Block> blockList; //区块信息

        @JSONField(name = "bc_chaincode")
        private List<Chaincode> chaincodeList; //链码信息

        @JSONField(name = "bc_tx")
        private List<Tx> txList; //交易信息

        @Data
        static class Block{
            private Integer blockNum;

            private Integer txCount;

            private String dataHash;

            private String preHash;

            private String createDt;
        }

        @Data
        static class Chaincode{
            private String chaincodeName;

            private String path;

            private String version;

            private Integer txCount;

            private String channelHash;
        }

        static class Tx{
            private String txHash;

            private String createDt;

            private String txContext;
        }
    }
}
